package chapter2;

public class 字符串 {
    public static void main(String[] args) {
    char[] cs = {'a','b','c','d','e','f','g','h'};
    byte[] bs = {-28,-72,-83,-27,-101,-67};
    String c = new String(cs);
    String b = new String(bs);
        System.out.println(c);
        System.out.println(b);
    String s = "a"+"b"+"c"+"d"+"e"+"f"+"g";
    String d = 1+"a"+2;
    String e = 2+3+"a";
        System.out.println(s);
        System.out.println(d);
        System.out.println(e);
        System.out.println(d.concat("abcd") );
        System.out.println("\'");
        System.out.println("a\tb\tc\td\te\tf\tg\th");
        System.out.println(s.equals(d));
        //TODO 比较字符串，equalsIgnoreCase可以忽略大小写
        int i = s.compareTo(b);
        System.out.println(i);
        //i = 0,相等，i<0,s<d.i>0,s>d.
        String a = "a";
        byte a1 = (byte)'a';
        System.out.println("a =" + a1);
        System.out.println(s.substring(0, 2));
        String[] s1 = s.split("b");
        System.out.println(s1.length);
        for (String s2 : s1) {
            System.out.println(s2);
        }
        System.out.println(s.replace("abc", "hellow"));
        System.out.println(a.toUpperCase());
        //TODO toLowerCase全部变小写
    }
}
